<?php
include_once("inc/conn.php");
include_once("inc/function.php");
include_once("heheadmin/inc/config.php");
if(isset($_SESSION['usersid'])) {
	echo ChangeEncodeU2G("<script >alert('你已经登录成功，你可以退出后再注册!');location.href = '/';</script>");
	exit;
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>帐号注册 - <?php echo $web_name ;?></title>
<?php
    require 'public/title.inc.php';
?>
<link rel="stylesheet" type="text/css" href="style/loginRegister.css" />
<script type="text/javascript" src="js/reg.js"></script>
</head>
<body>
<? include_once("top.php");?>
<div class="container">
    <div class="com regbg">
        <div class="row">
            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                <dl>
                    <dt>欢迎来到陌陌平台,没有账号,[ <a href="reg.php">去免费注册</a> ]</dt>
                    <dd>
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon">账　　号: </span>
                            <input type="text" class="form-control" id="username" placeholder="请输入手机号" />
                        </div>
                    </dd>
                    <dd>
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon">密　　码: </span>
                            <input type="password" class="form-control" id="pass" placeholder="请输入密码" />
                        </div>
                    </dd>
                    <dd>
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon">昵　　称: </span>
                            <input type="text" class="form-control" id="nickname" placeholder="昵称" />
                        </div>
                    </dd>
                    <dd>
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon">推荐人ID:</span>
                            <input type="text" class="form-control" value="<?php echo intval($_COOKIE['tj']);?>" id="tjid" placeholder="没有可不填写" />
                        </div>
                    </dd>
                    <dd>
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon">验 证 码 :</span>
                            <input type="text" class="form-control" id="svcode" placeholder="验证码" />
                            <span class="input-group-addon"><img src="vcode.php" alt="" onclick="this.src='vcode.php?tm=' + Math.random();"  style="cursor:pointer;" /></span>
                        </div>
                    </dd>
                    <dd>
                        <div class="input-group input-group-lg">
                            <span class="input-group-addon">短信验证码 :</span>
                            <input type="text" class="form-control yzm" id="vcode"  name="code" placeholder="验证码" />
                            <span class="input-group-addon"><a href="javcscrip:;" id="getcode">发送验证码</a></span>
                        </div>
                    </dd>
                    <dd>
                        <input type="submit" id="reg" class="btn btn-danger btn-block btn-lg" id="login" value="立即注册" />
                    </dd>
                    <dd class="">
                        <div class="input-group input-group-lg">
                           <a class="btn btn-default" href="/agreement.php">同意《协议》<input type="checkbox" checked="checked"  id="cbxSee"></a>
                        </div>
                    </dd>
                </dl>
            </div>
            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                <img src="img/regbg.png" class="img-responsive" style="margin:12px 20px; border-radius:10px;" />
            </div>
        </div>
    </div>
</div>

<script language="javascript" type="text/javascript">
    var times=60,cuttime;
    function getyzm(idn){
        times--;
        if(times>0&&times<60){
            $(idn).text(times+"秒后重新获取");
            $(idn).removeClass("btn-danger");
            cuttime=setTimeout(function(){getyzm(idn)},1000);
        }
        else{
            $(idn).text("获取短信验证码");
            times=60;
            $(idn).addClass("btn-danger");
            clearTimeout(cuttime);
        }
    }

    $(function(){
        $("#dl-tab li").bind({
            click:function(){
                $("#dl-tab li").removeClass("current");
                $(this).addClass("current");
                $("#login-box .login-form").hide();
                $("#login-box .login-form").eq($(this).index()).show();
                $(".yzm img").eq($(this).index()).attr("src","captcha.php?1337027384");
            }
        });

        $("#getcode").bind("click",function(){
            //getyzm("#getcode");
            var captcha=$("#svcode").val();
            if(captcha.length!=4){
                alerts("请输入验证码");
                return false;
            }
            var mobile=$("#username").val();
            var re = /^1\d{10}$/
            if (!re.test(mobile)) {
                alerts("请输入手机号码");
                return false;
            }
            //alerts("正在发送...");
            if(times==60){

                $.post('sms.php', {mobile: mobile,code:captcha}, function(data){
                    if(data.code>0){
                        alerts(data.data);
                    }else{
                        //console.log("zs");
                        alerts("发送成功,请查看!");
                        getyzm("#getcode");
                    }
                    $("#verify").trigger("click");
                }, 'json');
            }
            return false;
        });

    });
    function alerts(msg) {
        //console.log("s")
        alert(msg);
    }
</script>

<!--
    <div class="com">
    	<ul class="text"> 
        	<li>欢迎您注册本站用户，如果您已有帐号，[<a href="login.php">去登录</a>]</li>           
             <li><span>邮箱：</span><input id="username" type="text" class="uese" placeholder="输入最常用的邮箱" maxlength="50"></li>
            <li><span>密码：</span><input id="pass" type="password" class="pass" maxlength="50" placeholder="输入密码"></li>
            <li><span>昵称：</span><input id="nickname" type="text" class="mane" placeholder="输入昵称" maxlength="50"></li>
			<li><span>推荐人ID：</span><input id="tjid" name="tjid" class="mane" <?php 
			if(isset($_GET["uid"])){
				if(!empty($_GET["uid"])){
					echo 'value="'.$_GET["uid"].'" disabled="disabled" ';
				}
			}
			 ?>   maxlength="20" placeholder="没有可不填"/></li>
            <li><span>验证码：</span><input id="vcode" type="text" class="yzm" placeholder="验证码" maxlength="4"><img class="yzm_img" style="cursor: pointer;" alt="看不清请点击更换" src="vcode.php" onclick="this.src='vcode.php?t='+ Math.round(Math.random() * 10000)"></li>   
            <li class="btn"><input id="reg" type="button" class="ntb" value="立即注册"><p><input id="cbxSee" class="checkbox" type="checkbox" checked="checked">同意<a   href="/agreement.php" target="_blank">《协议》</a></p></li><p></p>
            
        </ul>
        <ul class="associate2">
        	
        </ul>
    </div>
    
-->
    
    
    
<? include_once("footer.php");?>
</body>
</html>
